{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "成绩等级是: A\n"
     ]
    }
   ],
   "source": [
    "def grade_level(score):\n",
    "    if score >= 90:\n",
    "        return \"A\"\n",
    "    elif score >= 80:\n",
    "        return \"B\"\n",
    "    elif score >= 70:\n",
    "        return \"C\"\n",
    "    elif score >= 60:\n",
    "        return \"D\"\n",
    "    else:\n",
    "        return \"F\"\n",
    "\n",
    "# 输入成绩\n",
    "score = float(input(\"请输入成绩: \"))\n",
    "grade = grade_level(score)\n",
    "print(f\"成绩等级是: {grade}\")\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
